#include <qua/io.h>
#include <qua/text.h>
#include <qua/fixed.h>
#include <qua/time.h>
#include <qua/cast.h>
#include <iostream>

namespace qua
{
    using std::ostream;
    using std::istream;
    using std::wostream;
    using std::wistream;

    ostream& operator << ( ostream& output, fixed const& value )
    {
        return output << cast<text>( value );
    }

    wostream& operator << ( wostream& output, fixed const& value )
    {
        return output << cast<text>( value );
    }

    istream& operator >> ( istream& input, fixed& value )
    {
        return input;
    }

    wistream& operator >> ( wistream& input, fixed& value )
    {
        return input;
    }

    ostream& operator << ( ostream& output, text const& value )
    {
        return output << value.to_encoding( output.getloc().name() );
    }

    wostream& operator << ( wostream& output, text const& value )
    {
        return output << value.to_wide();
    }

    istream& operator >> ( istream& input, text& value )
    {
        return input;
    }

    wistream& operator >> ( wistream& input, text& value )
    {
        return input;
    }

    ostream& operator << ( ostream& output, time const& value )
    {
        return output << cast<text>( value );
    }

    wostream& operator << ( wostream& output, time const& value )
    {
        return output << cast<text>( value );
    }

    istream& operator >> ( istream& input, time& value )
    {
        return input;
    }

    wistream& operator >> ( wistream& input, time& value )
    {
        return input;
    }
}
